﻿using B.S.Sterilizationcenter.ErrorCode;
using B.S.Sterilizationcenter.Writer.API.Appliaction.Commends.Zyy;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Sterilizationcenter.Writer.API.Controllers.ZYY.ReceivingApplications
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ReceivingApplicationController : ControllerBase
    {
        private readonly IMediator med;

        public ReceivingApplicationController(IMediator med)
        {
            this.med = med;
        }
        [HttpPost]
        public async Task<ApiResult<int>> AddReceivingApplication(AddReceivingApplicationcommand request, CancellationToken cancellationToken)
        {
            return await med.Send(request, cancellationToken);
        }
        [HttpPut]
        public async Task<ApiResult<int>> DeleteReceivingApplicationc(DeleteReceivingApplicationcommand request, CancellationToken cancellationToken)
        {
            return await med.Send(request, cancellationToken);
        }
        [HttpPut]
        public async Task<ApiResult<int>> UpdateReceivingApplicationc(UpdateReceivingApplicationcommand request, CancellationToken cancellationToken)
        {
            return await med.Send(request, cancellationToken);
        }

    }
}
